import 'package:my_photos/core/constants.dart';
import 'package:my_photos/logging.dart';
// import 'package:shared_preferences/shared_preferences.dart';

class Configuration {
  Configuration._privateConstructor();

  static final Configuration instance = Configuration._privateConstructor();

  static const endpoint = String.fromEnvironment(
    "endpoint",
    defaultValue: kDefaultProductionEndpoint,
  );

  static const emailKey = "email";

  // late SharedPreferences _preferences;

  Future<void> init() async {
    Logging.instance.$("init configuration");
    // _preferences = await SharedPreferences.getInstance();
    Logging.instance.$("finish configuration init");
  }

  Future<void> setEmial(String email) async {
    // await _preferences.setString(emailKey, email);
  }

  String getHttpEndpoint() {
    return endpoint;
  }

  String? getEmail() {
    // return _preferences.getString(emailKey);
  }
}
